#include "I2C.h"

//i2c_cmd_handle_t IIC_Cmd;		//I2C	Handle_t I2C链表

void I2C_Init(void)
{
    i2c_config_t i2c_str;
    //i2c_cmd_handle_t IIC_Cmd;		//I2C	Handle_t I2C链表
    i2c_str.mode = I2C_MODE_MASTER;
    i2c_str.scl_io_num = 18;
    i2c_str.sda_io_num = 19;
    i2c_str.scl_pullup_en = GPIO_PULLUP_ENABLE;
    i2c_str.sda_pullup_en = GPIO_PULLUP_ENABLE;
    i2c_str.master.clk_speed = 1000000 ;//OLDE刷新速度
    i2c_str.clk_flags = I2C_SCLK_SRC_FLAG_FOR_NOMAL;
    i2c_set_data_mode(I2C_NUM_0,I2C_DATA_MODE_MSB_FIRST,I2C_DATA_MODE_MSB_FIRST);
    i2c_param_config(I2C_NUM_0,&i2c_str);
    
    i2c_driver_install(I2C_NUM_0,I2C_MODE_MASTER,0, 0, 0);
    
  
    //IIC_Cmd = i2c_cmd_link_create();
    

}
